from django.contrib import admin

from goods.models import Goods, User, Category


class GoodsAdmin(admin.ModelAdmin):
    # 指定后台网页要显示的字段
    list_display = ["id", "category", 'title', "goods_price", "sales_volume", "evaluate_all", "evaluate_good",
                    "image_url", "goods_url"]


class UserAdmin(admin.ModelAdmin):
    # 指定后台网页要显示的字段
    list_per_page = 20
    list_display = ["id", 'user_name', "user_pwd"]
    actions_on_bottom = True
    actions_on_top = False
    search_fields = ['user_name']
    fi = ['user_pwd']


class CategoryAdmin(admin.ModelAdmin):
    # 指定后台网页要显示的字段
    list_display = ["id", "category"]


# 注册Model类
admin.site.register(User, UserAdmin)
admin.site.register(Goods, GoodsAdmin)
admin.site.register(Category, CategoryAdmin)

# Register your models here.
admin.site.site_title = "淘宝商品智能推荐系统"
admin.site.site_header = "淘宝商品智能推荐系统"
admin.site.index_title = "淘宝商品智能推荐系统"
